package com.tentcoo.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table(name = "t_teacher")
public class TeacherEntity implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8099710562796925712L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id")
	private int id;
	@Column(name = "phone")
	private String phone;
	@Column(name = "name")
	private String name;
	@Column(name = "clazz")
	private String clazz;
	@Column(name = "no")
	private String no;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getClazz() {
		return clazz;
	}

	public void setClazz(String clazz) {
		this.clazz = clazz;
	}

	public String getNo() {
		return no;
	}

	public void setNo(String no) {
		this.no = no;
	}

	// TODO toD
	@Override
	public String toString() {
		return "TeacherEntity [id=" + id + ", phone=" + phone + ", name=" + name + ", clazz=" + clazz + ", no=" + no
				+ "]";
	}

	//通过实体设置出id外，所有属性
	public void setEntity(TeacherEntity entity){
		this.no = entity.getNo();
		this.name = entity.getName();
		this.phone = entity.getPhone();
		this.clazz = entity.getClazz();
	}
}
